﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Vici.Mvc;
using System.Collections.Specialized;

namespace Company.Web
{

    public static class Application
    {
        public static void Init()
        {
            WebAppConfig.SessionType = typeof(DemoSession);


            Vici.Mvc.WebAppConfig.Router.AddDefaultRoutes(Web.Global.UrlExt); // ".aspx"                   
        

            //WebAppConfig.RegisterCustomObjectCreator(new DataObjectCreator());

            //WebAppConfig.AjaxProvider = new JQueryAjaxProvider();

            //WebAppConfig.Router.AddRoute("", "index");
        }

        public static DemoSession Session
        {
            get { return (DemoSession)WebAppContext.Session; }
        }
    }

    public class DemoSession : SessionBase
    {
        
    }

    public class DataObjectCreator : IObjectBinder
    {
        public bool TryConvert(string value, Type objectType, out object obj)
        {

            obj = null;

            return false;
        }

        public bool TryConvert(Type objectType, out object obj, NameValueCollection clientData)
        {
            throw new NotImplementedException();
        }
    }
}